import 'package:app/page/states/home/page_index_state_mixins.dart';
import 'package:app/utils/http_util.dart';
import 'package:flutter/cupertino.dart';

class MobilePageHome extends StatefulWidget {
  const MobilePageHome({super.key});

  @override
  State<StatefulWidget> createState() {
    return MobilePageHomeState();
  }
}

class MobilePageHomeState extends State<MobilePageHome>
    with PageIndexStateMixins {
  @override
  void initState() {
    super.initState();
    Future<String?> result =
        HttpUtil().get("https://sc.api.xiaotuzhi.top/sc/banner/getByType/home");
    result.then(
      (value) {
        /* if(result.)
            setState(() {
              if (value == null) {
                count = 0;
              } else {
                count = value.length;
              }
            }) */
      },
    ).catchError((err) {});
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text("当前数量$count", style: const TextStyle(fontSize: 30)),
    );
  }
}
